<?php $this->load->view('config/header');?>
<h1>Description <small>form entry</small></h1>
<ol class="breadcrumb">
  <li><a href="<?php echo site_url()?>home"><i class="icon-dashboard"></i> Dashboard</a></li>
  <li><a href="<?php echo site_url()?>description"><i class="icon-bar-chart"></i> Description</a></li>
  <li class="active"><i class="icon-file-alt"></i> Form <?php echo $mode; ?></li>
</ol>

<form class="form-horizontal" role="form" method="post" action="<?php echo site_url() ?>description/<?php echo $action; ?>" enctype="multipart/form-data">
	<input type="hidden" class="form-control" name="id_description" value="<?php echo @$detail[0]['id_description']?>">
	<input type="hidden" class="form-control" name="date_description" value="<?php echo @$detail[0]['date_description']?>">
	<div class="form-group">
		<label for="id_submenu" class="col-lg-2 control-label">Menu</label>
		<div class="col-lg-6">
			<select class="form-control" name="id_submenu">
				<?php if (@$submenu):?>
					<?php foreach ($submenu as $row):?>
						<?php if ($row['id_submenu'] == @$detail[0]['id_submenu']):?>
							<?php $selected =  'selected="selected"' ?>
						<?php else :?>
							<?php $selected =  '' ?>
						<?php endif;?>
						<option value="<?php echo $row['id_submenu'] ?>" <?php echo $selected ?> ><?php echo $row['nama_submenu'] ?></option>
					<?php endforeach?>
				<?php else :?>	
					<option value="">Belum ada Menu</option>
				<?php endif?>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label for="title_description" class="col-lg-2 control-label">Name Description</label>
		<div class="col-lg-6">
			<input type="text" class="form-control" name="title_description" value="<?php echo @$detail[0]['title_description']?>" />
		</div>
	</div>
	<div class="form-group">
		<label for="file_description" class="col-lg-2 control-label">File Description</label>
		<div class="col-lg-6">
			<?php if(@$detail[0]['file_description'] == "" || @$detail[0]['file_description'] == "0"):?>
				<input type="file" class="form-control" name="file_description"></input>
			<?php else:?>
				<input type="text" class="form-control" name="file_description" value="<?php echo @$detail[0]['file_description']?>" readonly="readonly"/>
			<?php endif;?>
		</div>
	</div>
	<div class="form-group">
		<label for="text_description" class="col-lg-2 control-label">Description</label>
		<div class="col-lg-10">
			<textarea class="ckeditor" name="text_description">
				<?php echo @$detail[0]['text_description']?>
			</textarea>
		</div>
	</div>
	<div class="form-group">
		<div class="col-lg-offset-2 col-lg-10">
			<input type="submit" name="submit" value="Simpan" class="btn btn-primary"/>
			<a href="<?php echo site_url()?>description" class="btn btn-primary">Batal</a>
		</div>
	</div>
</form>

<?php $this->load->view('config/footer');?>